<script setup lang="ts">
type Gender = 0 | 1

enum EGender {
  man,
  feman,
  aaa
}

const getGender = (xxx: EGender) => {
  console.log(xxx)
}
getGender(2)

const userGender: Gender = 1
type Dir = 1 | 2 | 3 | 4

// 枚举类型，即有类型又有值,它的值默认是从0开始的，后面的值没有定义的话是累加的(数字)
enum EDir {
  up = 1,
  down = 2,
  left = 3,
  right = 4
}
// 1:上 | 2：下 | 3：左 | 4：右
const fn = (d: EDir) => {
  console.log('方向:', d)
}
fn(EDir.left)

// 'xxa' a  xxb b   xxc c   xxd  d
enum EXxx {
  a = 'xxa',
  b = 'xxb',
  c = 'xxc',
  d = 'xxd'
}
</script>

<template>
  <div class="play-page">play</div>
</template>

<style lang="scss" scoped></style>
